/* CUC Online Judge - A cross-platform judge online system
 * Base on [Verwandlung Online Judge](https://github.com/hzxie/voj)
 * Copyright (C) 2021 Jinhe Zhang <307100890@qq.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 *                             /\/`\/\
 *                            _\ | | /_
 *                          -           -
 *                        /               \
 *                       | |-------------| |
 *                       | |^=-_#   #_-=^| |
 *                       \/ \O__/,_ \O__/ \/
 *                        \  \\\     \\\  /
 *                         _\     o     /_
 *                        |/ `--=___=--` \|
 *                       /              六 \
 *                      |  ____       __七_ |
 *                       \____/_\   /_\____/
 */
package org.verwandlung.voj.web.mapper;

import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import org.verwandlung.voj.web.model.ClassC;
import org.verwandlung.voj.web.model.Language;
import org.verwandlung.voj.web.model.User;

/**
 * User Data Access Object.
 * 
 * @author Haozhe Xie
 */
@CacheNamespace(implementation = org.mybatis.caches.ehcache.EhcacheCache.class)
public interface ClassCMapper {
	/**
	 * [此方法仅供管理员使用]
	 * 获取系统中某个用户组中用户的总数.
	 * @return 系统中某个用户组中用户的总数
	 */
	List<ClassC> getAllClasses(@Param("keyword1") String keyword1, @Param("keyword2") String keyword2, @Param("lang") Language lang, @Param("teacher") User teacher, @Param("offset") long offset, @Param("limit") int limit);
	
	long getCountofAllClasses(@Param("keyword") String keyword, @Param("teacher") User teacher);
	
	int createClass(ClassC classC);

	int deleteClass(@Param("cid") Long cid);

	ClassC getClassof(@Param("cid") Long cid);

}
